var Sys = {};
var ua = navigator.userAgent.toLowerCase();
var s;
(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;

var total_focus = picarry.length;
var currslid = 0 , slidint;
function setfoc(id){
  var focpic = $("focpic");
	focpic.src = picarry[id];
	$("foclnk").href = lnkarry[id];
	$("foctitle").innerHTML = '<a href="'+lnkarry[id]+'" target="_blank">'+ttlarry[id]+'</a>';
	currslid = id;
	for(i=0;i<total_focus;i++){
		$("tmb"+i).className = "thumb_off";
	};
	$("tmb"+id).className ="thumb_on";
	focpic.style.visibility = "hidden";
	if(Sys.ie){
	  focpic.filters[0].apply();
  	if (focpic.style.visibility == "visible") {
  		focpic.style.visibility = "hidden";
  		focpic.filters.revealTrans.transition=23;
  	}else {
  		focpic.style.visibility = "visible";
  		focpic.filters[0].transition=23;
  	}
  	focpic.filters[0].Play();	  
	}else{
  	if (focpic.style.visibility == "visible") {
  		focpic.style.visibility = "hidden";
  	}else {
  		focpic.style.visibility = "visible";
  	}
  }
	stopit();
}
function playnext(){
	if(currslid == total_focus-1){
		currslid = 0;
	}else{
		currslid++;
		if(currslid>=picarry.length){
			currslid=0;
		}
	}
	setfoc(currslid);
	playit();
}
function playit(){
	slidint = setTimeout(playnext,3000);
}
function stopit(){
	clearTimeout(slidint);
}
playit();
